Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add help note when using type in place of const #75611

Merged
merged 3 commits into from
Sep 11, 2020

Conversation

JulianKnodt
Copy link
Contributor

This adds a small help note when it might be possible that wrapping a parameter in braces might resolve the issue of having a type where a const was expected.

Currently, I am displaying the HirId, and I'm not particularly sure where to get the currently displayed path(?).

r? @lcnr

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 16, 2020
@JulianKnodt JulianKnodt force-pushed the cg_enum_err branch 2 times, most recently from 1ea9ffc to b3481d0 Compare August 17, 2020 00:35
@JulianKnodt JulianKnodt marked this pull request as ready for review August 20, 2020 02:45
src/librustc_typeck/astconv.rs Outdated Show resolved Hide resolved
src/librustc_typeck/astconv.rs Outdated Show resolved Hide resolved
help: If this generic argument was intended as a const parameter, try surrounding it with braces:
|
LL | test::<{ CompileFlag::A }>();
| ^ ^
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome ✨

will try and review the actual code changes next week.

@bors
Copy link
Contributor

bors commented Aug 22, 2020

☔ The latest upstream changes (presumably #75797) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
Initialized empty Git repository in /home/runner/work/rust/rust/.git/
##[command]git remote add origin https://github.com/rust-lang/rust
##[command]git config gc.auto 0
##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/75611/merge:refs/remotes/pull/75611/merge

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@JulianKnodt JulianKnodt force-pushed the cg_enum_err branch 5 times, most recently from b11589d to 4a21039 Compare August 22, 2020 06:00
@bors
Copy link
Contributor

bors commented Aug 30, 2020

☔ The latest upstream changes (presumably #74862) made this pull request unmergeable. Please resolve the merge conflicts.

@JulianKnodt JulianKnodt force-pushed the cg_enum_err branch 2 times, most recently from 6abde86 to 714c59b Compare September 1, 2020 21:00
@lcnr
Copy link
Contributor

lcnr commented Sep 11, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Sep 11, 2020

📌 Commit 96bb2c8 has been approved by lcnr

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 11, 2020
@bors
Copy link
Contributor

bors commented Sep 11, 2020

⌛ Testing commit 96bb2c8 with merge a742547...

@bors
Copy link
Contributor

bors commented Sep 11, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: lcnr
Pushing a742547 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 11, 2020
@bors bors merged commit a742547 into rust-lang:master Sep 11, 2020
@rustbot rustbot added this to the 1.48.0 milestone Sep 11, 2020
m-ou-se added a commit to m-ou-se/rust that referenced this pull request Nov 16, 2020
improve type const mismatch errors

Doesn't completely remove `check_generic_arg_count` as that would have required some more complex changes but
instead checks type and const params in only one step. Also moved the help added by `@JulianKnodt` in rust-lang#75611 to `generic_arg_mismatch_err`.

r? `@varkor` cc `@petrochenkov`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants